/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XPF
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface DailyPointsRule extends BasicModel<DailyPointsRule> {
  ruleId?: string; // 规则主键
  ruleType?: string; // 规则类（体测成绩、体育成绩）
  grade?: string; // 等级（体测“优秀、良好、合格、不合格”，体育“A等、B等、C等、D等”）
  score?: string; // 分值
}

export const dailyPointsRuleList = (params?: DailyPointsRule | any) =>
  defHttp.get<DailyPointsRule>({ url: adminPath + '/physical/dailyPointsRule/list', params });

export const dailyPointsRuleListData = (params?: DailyPointsRule | any) =>
  defHttp.post<Page<DailyPointsRule>>({ url: adminPath + '/physical/dailyPointsRule/listData', params });

export const dailyPointsRuleForm = (params?: DailyPointsRule | any) =>
  defHttp.get<DailyPointsRule>({ url: adminPath + '/physical/dailyPointsRule/form', params });

export const dailyPointsRuleSave = (params?: any, data?: DailyPointsRule | any) =>
  defHttp.postJson<DailyPointsRule>({ url: adminPath + '/physical/dailyPointsRule/save', params, data });

export const dailyPointsRuleDelete = (params?: DailyPointsRule | any) =>
  defHttp.get<DailyPointsRule>({ url: adminPath + '/physical/dailyPointsRule/delete', params });
